package com.ymatou.iapi.thirdpartysync.service;

import org.json.JSONObject;

import com.ymatou.iapi.couponmanage.parameter.sellerBatchInfos;
import com.ymatou.iapi.thirdpartysync.parameter.fqlSkuInfoList;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.database.model.thirdpartysync.fenqilesku;
import com.ymttest.utils.EnvSetup;
/**
*查询分期乐商品信息(交易)Call
*FreeMaker Template自动生成代码
*/
public class getSkuInfoCall extends YmatouBaseCall{
	private static String opurl ="fql/getSkuInfo";
	
	public getSkuInfoCall() {
		super(EnvSetup.getSystemUrl("thirdpartysync_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	
	public String getSuccess()
    {
        return getString("success");
    }
	
	/**
	 * 获取Data
	 * 
	 * @return
	 */
	public String getData() {
		String Code = null;
		try {
			Code = new JSONObject(getReturnData()).getString("data");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Code;
	}
	
	public fqlSkuInfoList getfenqilesku()
	{
		fqlSkuInfoList data = null;
        try {
            data = (fqlSkuInfoList) FormatUtil.GSONToObject(getData(), fqlSkuInfoList.class);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return data;
	}
}